﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using BrainTechLLC.ThreadSafeObjects;
#if USE_HYPER
using Hyper.ComponentModel;
#endif

namespace BrainTechLLC
{
    [DataContract]
    [Serializable]
#if NO_SILVERLIGHT
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter))]
    [EditorBrowsable(EditorBrowsableState.Always)]
#endif
    public class AbilityCollection : AssociatedIDCollection
    {
        public List<Command> EnabledCommands
        {
            get
            {
                List<IAbility> abilities = this.ReadItems<IAbility>();
                List<Command> commands = new List<Command>();
                
                for (int n = 0; n < abilities.Count; n++)
                {
                    IAbility ability = abilities[n];
                    commands.AddRange(ability.EnablesCommands);
                }

                return commands;
            }
        }
    }
}